import * as types from '../action-types';
import {delay, take, takeEvery, put, all, call, fork, cancel, cancelled, race} from 'redux-saga/effects';

function* start(){
  while(true){
    yield delay(1000);
    yield put({type: types.INCREMENT});
  }
}

export function* recorder() {
  yield race({
    // start:call(start)
    //↑↓都可
    start:start()
    ,stop:take(types.STOP)
  })
}
